package com.itheima.d_case;

/**
 * 案例二：交换两个变量的值。有int a=10;int b=50;
 */
public class CaseDemo02 {

    public static void main(String[] args) {
        //1 定义a和b两个变量
        int a = 10;
        int b = 50;
        //2 定义临时变量temp，将b的值赋值给temp
        int temp = b;
        b = a;//3 将a的值赋值b
        a = temp; //4 将temp的值赋值给a

        System.out.println("a = " + a);
        System.out.println("b = " + b);
    }
}
